import roleHarvester from "./role.harvester";
import roleUpgrader from "./role.upgrader";
import roleBuilder from "./role.builder";
import { autoAddCreep } from "./autoAddCreep";

export const loop = function () {
  console.log(Game.time);

  autoAddCreep();

  for (const name in Game.creeps) {
    const creep = Game.creeps[name];

    if (creep.memory.role == "harvester") {
      //收割机器人
      roleHarvester.run(creep);
    }
    if (creep.memory.role == "upgrader") {
      //升级机器人
      roleUpgrader.run(creep);
    }
    if (creep.memory.role == "builder") {
      //建造机器人
      roleBuilder.run(creep);
    }
  }
};
